<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <title>添加党课信息</title>
    <link href="/resources/bootstrap-3.3.5-dist/css/bootstrap.min.css" title="" rel="stylesheet"/>
    <link title="" href="/resources/css/style.css" rel="stylesheet" type="text/css"/>
    <link title="blue" href="/resources/css/dermadefault.css" rel="stylesheet" type="text/css"/>
    <link href="/resources/css/templatecss.css" rel="stylesheet" title="" type="text/css"/>
    <script src="/resources/script/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/resources/script/jquery.cookie.js" type="text/javascript"></script>
    <script src="/resources/bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript"></script>
    <style>
        label {
            text-align: right;
        }
    </style>
</head>

<body>
<nav class="nav navbar-default navbar-mystyle navbar-fixed-top">
    <div class="navbar-header">
        <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand mystyle-brand"><span class="glyphicon glyphicon-home"></span></a></div>
    <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li class="li-border"><a class="mystyle-color" href="/admin/index">管理控制台</a></li>
        </ul>
        <ul class="nav navbar-nav pull-right">
            <li class="dropdown li-border"><a href="#" class="dropdown-toggle mystyle-color"
                                              data-toggle="dropdown">${user.adminAccount}：已登录<span
                class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li><a href="/outLogin">退出</a></li>
                </ul>
            </li>
        </ul>
    </div>
</nav>
<div class="down-main">
    <div class="left-main left-full">
        <div class="sidebar-fold"><span class="glyphicon glyphicon-menu-hamburger"></span></div>
        <div class="subNavBox">
            <div class="sBox">
                <div class="subNav sublist-down"><span class="title-icon glyphicon glyphicon-chevron-down"></span><span
                    class="sublist-title">系统用户管理</span>
                </div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>首页</div>
                        <a href="/admin/index"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">首页</span></a>
                    </li>
                    <c:if test="${user.adminRole == '超级管理员'}">
                        <li>
                            <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>管理员账号管理
                            </div>
                            <a href="/admin/adminList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                                class="sub-title">管理员账号管理</span></a>
                        </li>

                        <li>
                            <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>添加管理员账号
                            </div>
                            <a href="/admin/goAddAdmin"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                                class="sub-title">添加管理员账号</span></a>
                        </li>
                    </c:if>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>修改密码</div>
                        <a href="/admin/goEditPassword"><span
                            class="sublist-icon glyphicon glyphicon-credit-card"></span><span
                            class="sub-title">修改密码</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">普通用户管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>用户信息查询</div>
                        <a href="/user/userList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">用户信息查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>用户信息添加</div>
                        <a href="/user/goAddUser"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">用户信息添加</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党员信息管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>正式党员查询</div>
                        <a href="/user/partyMember?intType=1"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">正式党员查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>预备党员查询</div>
                        <a href="/user/partyMember?intType=2"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">预备党员查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>发展对象查询</div>
                        <a href="/user/partyMember?intType=3"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">发展对象查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>入党积极分子查询
                        </div>
                        <a href="/user/partyMember?intType=4"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">入党积极分子查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>入党申请人查询
                        </div>
                        <a href="/user/partyMember?intType=5"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">入党申请人查询</span></a>
                    </li>

                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党组织管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党组织查询</div>
                        <a href="/party/partyList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党组织查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党组织添加</div>
                        <a href="/party/goAddParty"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党组织添加</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党员党课成绩</span></div>
                <ul class="navContent" style="display:block">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党课信息查询</div>
                        <a href="/partycourse/courseList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党课信息查询</span></a>
                    </li>
                    <li class="active">
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党课添加</div>
                        <a href="/partycourse/goAddCourse"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党课添加</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党费信息管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党费信息查询</div>
                        <a href="/money/moneyList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党费信息查询</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党员成绩管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党员成绩查询</div>
                        <a href="/partygrade/gradeList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党员成绩查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党员成绩添加</div>
                        <a href="/partygrade/goAddGrade"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党员成绩添加</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">通知信息管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>通知信息查询</div>
                        <a href="/notice/noticeList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">通知信息查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>通知信息添加</div>
                        <a href="/notice/goAdd"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">通知信息添加</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党员活动管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>活动信息查询</div>
                        <a href="/active/activeList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">活动信息查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>活动信息添加</div>
                        <a href="/active/goAdd"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">活动信息添加</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">操作日志管理</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>操作日志查询</div>
                        <a href="/option/optionList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">操作日志查询</span></a>
                    </li>
                </ul>
            </div>
            <c:if test="${user.adminRole == '超级管理员'}">
                <div class="sBox">
                    <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                        class="sublist-title">数据备份</span></div>
                    <ul class="navContent" style="display:none">
                        <li>
                            <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>数据备份</div>
                            <a href="javascript:void(0);" onclick="databasebackup()"><span class="sublist-icon glyphicon glyphicon-user"></span><span class="sub-title">数据备份</span></a>
                        </li>
                    </ul>
                </div>
            </c:if>
        </div>
    </div>
    <div class="right-product view-product right-full">
        <div class="container-fluid">
            <div class="info-center">
                <div class="page-header">
                    <div class="pull-left">
                        <h4><strong style="font-family: STXingkai;font-size: 30px; ">添加党课</strong></h4>
                    </div>
                    <div class="pull-right">
                        <button class=" btn btn-info btn-md btn-block" style="position: relative; margin: 10px;"
                                type="button" onclick="add()">提交
                        </button>
                    </div>
                </div>

                <div class="indentify-class padding-lr">
                    <div class="myform-content">
                        <form class="form-horizontal2" id="formadd" action="/partycourse/addCourse" method="post" role="form">
                            <br/>
                            <div class="form-group formdiv row">
                                <label for="courseName" class="col-md-2 control-label">党课名称:</label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" id="courseName" name="courseName" value=""
                                           placeholder="请输入...">
                                </div>
                                <label for="courseTime" class="col-md-2 control-label">党课时间:</label>
                                <div class="col-md-4">
                                    <input type="date" class="form-control" id="courseTime" name="courseTime" value=""
                                           pattern="yyyy-MM-dd">
                                </div>
                            </div>
                            <br/>
                            <div class="form-group formdiv row">
                                <label for="courseDesc" class="col-md-2 control-label">党课描述:</label>
                                <div class="col-md-10">
											<textarea type="text" class="form-control" rows="10" cols="20"
                                                      id="courseDesc" name="courseDesc" value=""
                                                      placeholder="请输入..."></textarea>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        /*左侧导航栏显示隐藏功能*/
        $(".subNav").click(function () {
            /*显示*/
            if ($(this).find("span:first-child").attr('class') == "title-icon glyphicon glyphicon-chevron-down") {
                $(this).find("span:first-child").removeClass("glyphicon-chevron-down");
                $(this).find("span:first-child").addClass("glyphicon-chevron-up");
                $(this).removeClass("sublist-down");
                $(this).addClass("sublist-up");
            }
            /*隐藏*/
            else {
                $(this).find("span:first-child").removeClass("glyphicon-chevron-up");
                $(this).find("span:first-child").addClass("glyphicon-chevron-down");
                $(this).removeClass("sublist-up");
                $(this).addClass("sublist-down");
            }
            // 修改数字控制速度， slideUp(500)控制卷起速度
            $(this).next(".navContent").slideToggle(300).siblings(".navContent").slideUp(300);
        })
        /*左侧导航栏缩进功能*/
        $(".left-main .sidebar-fold").click(function () {

            if ($(this).parent().attr('class') == "left-main left-full") {
                $(this).parent().removeClass("left-full");
                $(this).parent().addClass("left-off");

                $(this).parent().parent().find(".right-product").removeClass("right-full");
                $(this).parent().parent().find(".right-product").addClass("right-off");

            } else {
                $(this).parent().removeClass("left-off");
                $(this).parent().addClass("left-full");

                $(this).parent().parent().find(".right-product").removeClass("right-off");
                $(this).parent().parent().find(".right-product").addClass("right-full");

            }
        })

        /*左侧鼠标移入提示功能*/
        $(".sBox ul li").mouseenter(function () {
            if ($(this).find("span:last-child").css("display") == "none") {
                $(this).find("div").show();
            }
        }).mouseleave(function () {
            $(this).find("div").hide();
        });


    })
    /**
     * 校验文本是否为空
     * tips：提示信息
     * 使用方法：$("#id").validate("提示文本");
     * @itmyhome
     */
    $.fn.validate = function (tips) {
        if ($(this).val() == "" || $.trim($(this).val()).length == 0) {
            alert(tips + "不能为空！");
            throw SyntaxError(); //如果验证不通过，则不执行后面
        }
    }

    function add() {
        //调用validate()
        $("#courseName").validate("党课标题");
        $('#formadd').submit();
    }
    //数据库备份
    function databasebackup() {
        if (confirm("请确认操作")) {
            $.ajax({
                url: '/databasebackup',
                type: 'post',
                dataType: 'json',
                success: function (data) {
                    if (data.errno == 0) {
                        alert(data.message);
                        location.reload()
                    } else {
                        alert(data.message);
                    }
                }
            });
        } else {
            location.reload()
        }
    }
</script>
</body>
</html>
